package com.skyline.wizard.dao.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.stereotype.Repository;

import com.skyline.wizard.dao.SeUpdateDao;
import com.skyline.wizard.mapper.SeUpdateTimeMapper;

@Repository("seUpdateDao")
public class SeUpdateDaoImpl implements SeUpdateDao {

	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	@Value("${wizard.seId}")
	private Integer seId;
	
	@Value("${SeUpdateDao.queryLastUpdateTime}")
	private String queryLastUpdateTimeSql;
	
	@Value("${SeUpdateDao.updateLastUpdateTime}")
	private String updateLastUpdateTimeSql;
	
	@Override
	public Date queryLastUpdateTime(int seDocType) {
		return jdbcTemplate.queryForObject(queryLastUpdateTimeSql, SeUpdateTimeMapper.getMapper(),seDocType,seId);
	}

	@Override
	public void updateLastUpdateTime(int seDocType) {
		jdbcTemplate.update(updateLastUpdateTimeSql,seDocType,seId);
	}

}
